<script type="text/javascript">
    $(function(){
        trbgmoves('#d3dff2');
    })
</script>
<!--top结束-->
<div class="mian">
    <div class="mian1">
        <div class="mian2">
            <!--left start-->
            <?php $this->load->view('defaults/common/left');?>
            <!--left end-->

            <!--right start-->
            <div class="right">
                <!--breadcrumb start-->
                <div class="righta"  style="width: 1200px;"><?=$this->breadcrumb->generateHTML();?> <span style="color: red"><?=$msg?></span> </div>
                <!--breadcrumb end-->

                <!-- contents start -->
                <div id="contents" style="width: 1200px;">
                    <div class="ct_content"  style="width: 1200px;">
                        <table class="tbwd800" cellspacing="0"  style="width: 1200px;">
                            <thead class="table_thead" >
                            <tr align="center">
                                <th width="7%" >申请人</th>
                                <th width="15%" >申请网站</th>
                                <th width="10%" >申请API</th>
                                <th width="13%" >appID</th>
                                <th width="35%" >appsecret</th>
                                <th width="10%" >申请时间</th>
                                <th width="5%" >状态</th>
                                <th width="" >操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php foreach ($apilist as $key=>$rs):?>
                                <tr class="moves" align="center">
                                    <td width=""><?=$rs['name']?></td>
                                    <td width=""><?=$rs['url']?></td>
                                    <td width=""><?=$rs['apitypename']?></td>
                                    <td width=""><?=$rs['appid']?></td>
                                    <td width=""><?=$rs['appsecret']?></td>
                                    <td width=""><?=date('Y-m-d H',$rs['addtime'])?></td>
                                    <td width="">
                                        <?php
                                            switch($rs['status']){
                                                case '1':
                                                    echo '未授权';
                                                    break;
                                                case '2':
                                                    echo "<span style='color:green'>已授权</span>";
                                                    break;
                                                case '3':
                                                    echo "<span style='color:red'>已禁封</span>";
                                                    break;
                                            }
                                        ?>
                                    </td>
                                    <td width="">
                                        <?php if($rs['status']==1){?>
                                        <a href="<?=blang_url('orders/apiorder/authorizeapp/sq/'.$rs['id'])?>" onclick="return confirm('你确定授权给他吗？')">授权</a>
                                        <?php }?>
                                        <?php if($rs['status']==3){?>
                                        <a href="<?=blang_url('orders/apiorder/authorizeapp/qy/'.$rs['id'])?>" onclick="return confirm('你确定启用他吗？')"><span style="color:green">启用</span></a>
                                        <?php }?>
                                        <?php if($rs['status']==2){?>
                                        <a href="<?=blang_url('orders/apiorder/authorizeapp/jf/'.$rs['id'])?>" onclick="return confirm('你确定禁封他吗？')"><span style="color: red">禁封</span></a>
                                        <?php }?>
                                    </td>
                                </tr>
                            <?php endforeach;?>
                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- contents end -->
            </div>
            <!--right end-->
        </div>
    </div>
</div>